package com.learn.design.visitor.test;

import java.time.Instant;
import java.util.ArrayList;
import java.util.List;

public class SendClient {

    public static void main(String[] args) {
        List<AbstractSendSms> smsArrayList = new ArrayList<>();

        smsArrayList.add(new TencentSendSms()
                .setType(1)
                .setCode("123456")
                .setAccessKey("tencent_access_key")
                .setAccessSecert("tencent_access_secert")
                .setPhone("1565685858")
                .setSendTime(Instant.now())
        );
        smsArrayList.add(new TencentSendSms()
                .setType(2)
                .setAccessKey("tencent_access_key")
                .setAccessSecert("tencent_access_secert")
                .setPhone("1565685858")
                .setSendTime(Instant.now())
                .setContent("this is code sms")
        );
        smsArrayList.add(new AlySendSms()
                .setType(2)
                .setAccessKey("aly_access_key")
                .setAccessSecert("aly_access_secert")
                .setPhone("1565685858")
                .setSendTime(Instant.now())
                .setContent("this is code sms")
        );
        smsArrayList.add(new AlySendSms()
                .setType(1)
                .setCode("123456")
                .setAccessKey("aly_access_key")
                .setAccessSecert("aly_access_secert")
                .setPhone("1565685858")
                .setSendTime(Instant.now())
        );

        smsArrayList.forEach(sms -> sms.accept(new SendSmsVisitorImpl()));


    }
}
